#ifndef TOKENLINE_H_
#define TOKENLINE_H_

#include <string>
#include <vector>

/**
 * A TokenLine is a line of tokenized content.  It provides convenience
 * functions to easily convert string tokens to other types such as float and
 * int, or even convert the entire line to a vector.
 */
class TokenLine {
private:
	std::vector<std::string> tokens;
public:
	/**
	 * Creates a TokenLine from a string, split upon the delimiter
	 */
	TokenLine(std::string line, char delimiter);

	/**
	 * @return A string from the given position
	 */
	std::string getString(unsigned int position) const;

	/**
	 * @return A char* from the given position
	 */
	std::string getChars(unsigned int position) const;

	/**
	 * @return An int from the given position
	 */
	int getInt(unsigned int position) const;

	/**
	 * @return A float from the given position.
	 */
	float getFloat(unsigned int position) const;

	/**
	 * @return A double from the given position.
	 */
	double getDouble(unsigned int position) const;

	/**
	 * @return A long from the given position
	 */
	long getLong(unsigned int position) const;

	/**
	 * @return Whether the token at position is empty
	 */
	bool isEmpty(unsigned int position) const;

	unsigned int size() const;

	virtual ~TokenLine();
};

#endif /* TOKENLINE_H_ */
